/*
 * @Author: moeWang
 * @Date: 2022-03-02 16:00:35
 * @LastEditTime: 2022-03-03 14:32:08
 * @LastEditors: moeWang
 * @Description:
 * @FilePath: \nest-web\src\logical\common\models\BaseListResult.model.ts
 */

import { ApiPropertyOptional } from '@nestjs/swagger';
import { Pagination } from './Pagination.model';

export class BaseListResultModel<T> {
  @ApiPropertyOptional({ description: '返回标识' })
  private error_code: number = 200;

  @ApiPropertyOptional({ description: '错误信息' })
  private error_msg: string = '';

  private datas: Array<T>;

  private pagination: Pagination;

  public getError_code(): number {
    return this.error_code;
  }

  public setError_code(error_code: number): void {
    this.error_code = error_code;
  }

  public getError_msg(): string {
    return this.error_msg;
  }

  public setError_msg(error_msg: string): void {
    this.error_msg = error_msg;
  }

  public getDatas(): Array<T> {
    return this.datas;
  }

  public setDatas(datas: Array<T>): void {
    this.datas = datas;
  }

  public getPagination(): Pagination {
    return this.pagination;
  }

  public setPagination(pagination: Pagination): void {
    this.pagination = pagination;
  }
}
